import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    // url: '/api/rb-oem/oem/posStaff/pos_staff/list',
    url: '/api/rb-oem/oem/posStaff/pos_staff/listV2',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    // url: '/api/rb-oem/oem/posStaff/pos_staff/detail',
    url: '/api/rb-oem/oem/posStaff/pos_staff/detailV2',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/rb-oem/oem/posStaff/pos_staff/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    // url: '/api/rb-oem/oem/posStaff/pos_staff/submit',
    url: '/api/rb-oem/oem/posStaff/pos_staff/submitV2',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    // url: '/api/rb-oem/oem/posStaff/pos_staff/submit',
    url: '/api/rb-oem/oem/posStaff/pos_staff/submitV2',
    method: 'post',
    data: row
  })
}

export const getUpdatePwd = (row) => {
  return request({
    // url: '/api/rb-oem/oem/posStaff/pos_staff/updatePass',
    url: '/api/rb-oem/oem/posStaff/pos_staff/updatePassV2',
    method: 'post',
    data: row
  })
}

/* 收银员状态 控制 0否1是 */
export const changeStaffStatus = (id, isOn) => {
  return request({
    url: '/api/rb-oem/oem/posStaff/pos_staff/changeStoreStatus',
    method: 'post',
    params: {
      id,
      isOn
    }
  })
}